package com.nts.visionworks.business.contents.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Range;

/**
 * ContentsTemplate generated by hbm2java
 */
@Entity
@Table(name = "contents_template", catalog = "visionworks")
public class ContentsTemplate implements java.io.Serializable
{

	private Integer templateId;
	private String templateName;
	private boolean deleted;
	private Date createdDateTime;
	private long creatorId;
	private Date updatedDateTime;
	private Set<ContentsTemplateElement> contentsTemplateElements = new HashSet<ContentsTemplateElement>(
			0);
	private Set<ContentsTemplateAttribute> contentsTemplateAttributes = new HashSet<ContentsTemplateAttribute>(
			0);
	private Set<Contents> contentses = new HashSet<Contents>(0);

	public ContentsTemplate()
	{
	}

	public ContentsTemplate(String templateName, boolean deleted,
			Date createdDateTime, long creatorId)
	{
		this.templateName = templateName;
		this.deleted = deleted;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
	}

	public ContentsTemplate(String templateName, boolean deleted,
			Date createdDateTime, long creatorId, Date updatedDateTime,
			Set<ContentsTemplateElement> contentsTemplateElements,
			Set<ContentsTemplateAttribute> contentsTemplateAttributes,
			Set<Contents> contentses)
	{
		this.templateName = templateName;
		this.deleted = deleted;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
		this.updatedDateTime = updatedDateTime;
		this.contentsTemplateElements = contentsTemplateElements;
		this.contentsTemplateAttributes = contentsTemplateAttributes;
		this.contentses = contentses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "TemplateId", unique = true, nullable = false)
	public Integer getTemplateId()
	{
		return this.templateId;
	}

	public void setTemplateId(Integer templateId)
	{
		this.templateId = templateId;
	}

	@NotNull(message = "validation.contents.template.templatename.notnull")
	@Range(message = "validation.contents.template.templatename.length", max = 30, min = 1)
	@Column(name = "TemplateName", nullable = false, length = 30)
	public String getTemplateName()
	{
		return this.templateName;
	}

	public void setTemplateName(String templateName)
	{
		this.templateName = templateName;
	}

	@Column(name = "Deleted", nullable = false)
	public boolean isDeleted()
	{
		return this.deleted;
	}

	public void setDeleted(boolean deleted)
	{
		this.deleted = deleted;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreatedDateTime", nullable = false, length = 19)
	public Date getCreatedDateTime()
	{
		return this.createdDateTime;
	}

	public void setCreatedDateTime(Date createdDateTime)
	{
		this.createdDateTime = createdDateTime;
	}

	@Column(name = "CreatorId", nullable = false)
	public long getCreatorId()
	{
		return this.creatorId;
	}

	public void setCreatorId(long creatorId)
	{
		this.creatorId = creatorId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UpdatedDateTime", length = 19)
	public Date getUpdatedDateTime()
	{
		return this.updatedDateTime;
	}

	public void setUpdatedDateTime(Date updatedDateTime)
	{
		this.updatedDateTime = updatedDateTime;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contentsTemplate")
	public Set<ContentsTemplateElement> getContentsTemplateElements()
	{
		return this.contentsTemplateElements;
	}

	public void setContentsTemplateElements(
			Set<ContentsTemplateElement> contentsTemplateElements)
	{
		this.contentsTemplateElements = contentsTemplateElements;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contentsTemplate")
	public Set<ContentsTemplateAttribute> getContentsTemplateAttributes()
	{
		return this.contentsTemplateAttributes;
	}

	public void setContentsTemplateAttributes(
			Set<ContentsTemplateAttribute> contentsTemplateAttributes)
	{
		this.contentsTemplateAttributes = contentsTemplateAttributes;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "contentsTemplate")
	public Set<Contents> getContentses()
	{
		return this.contentses;
	}

	public void setContentses(Set<Contents> contentses)
	{
		this.contentses = contentses;
	}

}
